<div id="mapasociedad">
	
<div id="fotococina">
</div> 
<div id="mesa1">
</div>
<div id="mesa2">
</div>
<div id="mesa3">
</div>
<div id="mesa4">
</div>
<div id="mesa5">
</div>
</div>	
<div id="fechareserva">
<table class="tablaticket" width="100%">
	<font class="ticket_tit">OCUPACION DE LAS MESAS</font><br><br>
	<tr>
		<td width="81" scope="col">Capacidad</td>
		<td width="81" scope="col">Ma&ntilde;ana</td>
		<td width="94" scope="col">Tarde</td>
	</tr>
	{$parimpar=1}
		{foreach from=$totalMesas item=idMesa}
			{$flag=0}
			{if isset($reservaActual)}
				{foreach from=$reservaActual item=reserva}
					{if $reserva.idMesa eq $idMesa.id}
						{$flag=1}
						<tr>
								{if $parimpar eq 1}
									<td class="impar">{$idMesa.capacidad}</td>
									{if $reserva.horario eq 1}
										{if $session.user.id eq $reserva.idSocio}
											<td class="impar">
												<input type="checkbox" name="reserva[1]" value="checkbox" checked="checked" />Mesa {$idMesa.id}
											</td>
										{else}
											<td class="impar">
												<input type="checkbox" name="reserva[1]" value="checkbox" checked="checked" disabled="true"/>Mesa {$idMesa.id}
											</td>
										{/if}
									{else}
										<td class="impar">
											<input type="checkbox" name="reserva[1]" value="checkbox" />Mesa {$idMesa.id}
										</td>
									{/if}
									{if $reserva.horario eq 2}
										{if $session.user.id eq $reserva.idSocio}
											<td class="impar">
												<input type="checkbox" name="reserva[2]" value="checkbox" checked="checked"/>Mesa {$idMesa.id}
											</td>
										{else}
											<td class="impar">
												<input type="checkbox" name="reserva[2]" value="checkbox" checked="checked" disabled="true"/>Mesa {$idMesa.id}
											</td>
										{/if}
									{else}
										<td class="impar">
											<input type="checkbox" name="reserva[2]" value="checkbox" />Mesa {$idMesa.id}
										</td>
									{/if}	
								{$parimpar=0}
								{else}
									<td class="par">{$idMesa.capacidad}</td>
									{if $reserva.horario eq 1}
										{if $session.user.id eq $reserva.idSocio}
											<td class="par">
												<input type="checkbox" name="reserva[1]" value="checkbox" checked="checked"/>Mesa {$idMesa.id}
											</td>
										{else}
											<td class="par">
												<input type="checkbox" name="reserva[1]" value="checkbox" checked="checked" disabled="true"/>Mesa {$idMesa.id}
											</td>
										{/if}
									{else}
										<td class="par">
											<input type="checkbox" name="reserva[1]" value="checkbox" />Mesa {$idMesa.id}
										</td>
									{/if}
									{if $reserva.horario eq 2}
										{if $session.user.id eq $reserva.idSocio}		
											<td class="par">
												<input type="checkbox" name="reserva[2]" value="checkbox" checked="checked"/>Mesa {$idMesa.id}
											</td>
										{else}
											<td class="par">
												<input type="checkbox" name="reserva[2]" value="checkbox" checked="checked" disabled="true"/>Mesa {$idMesa.id}
											</td>
										{/if}
									{else}
										<td class="par">
											<input type="checkbox" name="reserva[2]" value="checkbox" />Mesa {$idMesa.id}
										</td>
									{/if}
								{$parimpar=1}
								{$flag=1}
								{/if}
							</tr>
					{/if}
				{/foreach}
				{if $flag neq 1}
					<tr>
						{if $parimpar eq 1}
							<td class="impar">{$idMesa.capacidad}</td>
							<td class="impar">
								<input type="checkbox" name="reserva[1]" value="checkbox" />Mesa {$idMesa.id}
							</td>
							<td class="impar">
								<input type="checkbox" name="reserva[2]" value="checkbox" />Mesa {$idMesa.id}
							</td>
							{$parimpar=0}
						{else}
							<td class="par">{$idMesa.capacidad}</td>
							<td class="par">
								<input type="checkbox" name="reserva[1]" value="checkbox" />Mesa {$idMesa.id}
							</td>
							<td class="par">
								<input type="checkbox" name="reserva[2]" value="checkbox" />Mesa {$idMesa.id}
							</td>
							{$parimpar=1}
						{/if}
					</tr>
				{/if}
			{else}
					<tr>
						{if $parimpar eq 1}
							<td class="impar">{$idMesa.capacidad}</td>
							<td class="impar">
								<input type="checkbox" name="reserva[1]" value="checkbox" />Mesa {$idMesa.id}
							</td>
							<td class="impar">
								<input type="checkbox" name="reserva[2]" value="checkbox" />Mesa {$idMesa.id}
							</td>
							{$parimpar=0}
						{else}
							<td class="par">{$idMesa.capacidad}</td>
							<td class="par">
								<input type="checkbox" name="reserva[1]" value="checkbox" />Mesa {$idMesa.id}
							</td>
							<td class="par">
								<input type="checkbox" name="reserva[2]" value="checkbox" />Mesa {$idMesa.id}
							</td>
							{$parimpar=1}
						{/if}
					</tr>

			{/if}
		{/foreach}
</table>
<br/>
<h4>Fecha actual: {$fechaActual}</h4>
<a href="index.php?module=socios&action=reservaMesas" onclick="javascript:window.open('templates/calendario.php','','height=200,width=180')" on>Seleccionar fecha</a>
<br/><br/>
<button style='width:130px; height:29px; font-weight: bold; font-size: 10px;' class="button" type="button" onclick="location.href = 'index.php?module=socios&action=reservaMesas&reservar'" >Reservar Mesa</button>
&nbsp;&nbsp;&nbsp;&nbsp;
<button style='width:130px; height:29px; font-weight: bold; font-size: 10px;' class="button" type="button" onclick="location.href = 'index.php?module=socios&action=reservaMesas&quitarse'" >Desapuntarme</button>
